@extends('backstage.layout.master')
@section('title', '更新模板属性')
@section('style')
        <!-- page specific plugin styles -->

<link rel="stylesheet" href="assets/css/jquery-ui-1.10.3.custom.min.css"/>
<link rel="stylesheet" href="assets/css/chosen.css"/>
<link rel="stylesheet" href="assets/css/datepicker.css"/>
<link rel="stylesheet" href="assets/css/bootstrap-timepicker.css"/>
<link rel="stylesheet" href="assets/css/daterangepicker.css"/>
<link rel="stylesheet" href="assets/css/colorpicker.css"/>

<!-- fonts -->

@stop
@section('content')
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try {
                ace.settings.check('breadcrumbs', 'fixed')
            } catch (e) {
            }
        </script>

        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i>
                <a target="_blank" href="/backstage/home">主页</a>
            </li>

            <li class="active">
                <a target="_blank" href="/backstage/product-temp/temp-attr-list">产品模板属性列表</a>
            </li>
            <li>
                添加模板属性
            </li>
        </ul><!-- .breadcrumb -->
    </div>

    <div class="page-content">
        <div class="row">
            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->
                <div class="page-header">
                    <h1>
                        产品模板
                        <small>
                            <i class="icon-double-angle-right"></i>
                            添加模板属性
                        </small>
                        <span class="pull-right">
                        <button class="btn btn-primary" onclick="javascript:window.location.href='{{asset('')}}backstage/product-temp/temp-attr-list';">返回模板属性列表</button>
                     </span>
                    </h1>
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->

                        <form class="form-horizontal" role="form" action="/backstage/product-temp/update-temp-attr" method="post" enctype="multipart/form-data">
                            <div class="form-group {{$errors->first('attr_id')!=""?'has-error':''}}">
                                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 编号 </label>

                                <div class="col-sm-4">
                                    <input type="text" name="attr_id" readonly value="{{isset($temp_attr->attr_id)?$temp_attr->attr_id:0}}"class="width-100">
                                </div>
                                <div class="col-sm-5">
                                    <div class="help-block col-xs-12 col-sm-reset inline"> {{$errors->first('attr_id')}}</div>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group ">
                                <label class="col-sm-3 control-label no-padding-right" for="form-field-1">模板分类</label>
                                <div class="col-sm-4">
                                    <select name="category_id" class="form-control" id="form-field-select-1">
                                        @foreach($temp_categorys as $temp_category)
                                            <option @if($temp_attr->category_id==$temp_category->id) selected @endif value={{isset($temp_category->id)?$temp_category->id:0}}>{{isset($temp_category->name)?$temp_category->name:''}}</option>
                                        @endforeach
                                    </select>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group {{$errors->first('attr_name')!=""?'has-error':''}}">
                                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 属性名 </label>

                                <div class="col-sm-4">
                                    <input type="text" name="attr_name" value="{{isset($temp_attr->attr_name)?$temp_attr->attr_name:""}}"class="width-100">
                                    <input type="hidden" name="id" value={{isset($temp_attr->id)?$temp_attr->id:0}}>
                                </div>
                                <div class="col-sm-5">
                                    <div class="help-block col-xs-12 col-sm-reset inline"> {{$errors->first('attr_name')}}</div>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group {{$errors->first('attr_values')!=""?'has-error':''}}">
                                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 属性值 </label>
                                <div class="col-sm-4">
                                    <input type="text" name="attr_values" id="attr_values" value="{{isset($temp_attr->attr_values)?$temp_attr->attr_values:""}}" placeholder="例如:短袖|长袖"
                                           class="width-100">
                                </div>
                                <div class="col-sm-5">
                                    <div class="help-block col-xs-12 col-sm-reset inline"> {{$errors->first('attr_values')}}</div>
                                </div>
                            </div>
                            <div class="clearfix form-actions">
                                <div class="col-md-offset-3 col-md-9">
                                    <button class="btn btn-info" type="submit">
                                        <i class="icon-ok bigger-110"></i>
                                        保存
                                    </button>
                                </div>
                            </div>
                        </form>


                    </div><!-- /.col -->
                </div>
                <!-- PAGE CONTENT ENDS -->
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.page-content -->
@stop
@section('script')
    <script src="assets/js/bootstrap-colorpicker.min.js"></script>
    <script type="text/javascript">
        $(function () {
          });
    </script>
@stop